import $store from '@/store/index.js';
import msgSqlite from "@/sqlite_services/msg.js"
//拉黑
const handle = async(data)=>{
	try{
		let myId = $store.state.user.user_info.user_id; // 获取当前用户ID
		let conversationId = data.sender_id == myId ? data.target_id : data.sender_id;
		$store.dispatch('removeSession', conversationId)
		msgSqlite.delMsgUserId(conversationId, data.chat_type)
		const activeChatUuid = $store.state.chat.chatInfo && $store.state.chat.chatInfo.uuid || ''; // 访问根级状态的chatInfo
		if(conversationId == activeChatUuid){
			uni.$emit('onMessageControls', {
				type:'clearChat'
			})
		}
	}catch(e){
		
	}
}
export default handle